package old.day20190318.dao;


import org.apache.commons.beanutils.BeanUtils;

import java.lang.reflect.InvocationTargetException;

/**
 * @author DingZhenYun
 * @create 2019-03-20 10:03
 */
public class BeanUtilsTest {
    public static void main(String[] args) {
        Object o=new ExamStudent();
        Object cc=null;
        System.out.println(o);
        try {
            BeanUtils.setProperty(o,"idCard","22222222223");
            cc=BeanUtils.getProperty(o,"idCard");
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        } catch (InvocationTargetException e) {
            e.printStackTrace();
        } catch (NoSuchMethodException e) {
            e.printStackTrace();
        }
        System.out.println(o);
        System.out.println(cc);
    }
}
